MCP
BindAI provides a lightweight HTTP-based MCP integration package for discovering and invoking external tools. The current implementation is intentionally small and focused on connecting BindAI’s tool system to an HTTP service that exposes a simple tool-discovery and tool-invocation interface. It should be understood as a lightweight HTTP bridge, not as a complete implementation of the Model Context Protocol.Current MCP Scope
Thebindai-mcp package currently provides:
MCPClientMCPTool- HTTP-based tool discovery
- HTTP-based tool invocation
- Tool metadata and schema mapping
- Integration with the BindAI tool abstraction
MCP Package
The package is:Architecture
The current implementation can be understood as:MCPClient discovers those tools and creates MCPTool instances that can participate in the BindAI tool system.
MCPClient
MCPClient is the client used to communicate with the external HTTP tool service.
Create a client with the service URL:
connect() or disconnect() methods.
It also does not maintain a persistent MCP session.
Tool Discovery
Tool discovery is performed with:MCPTool.
Tool Metadata
An externally discovered tool can provide:namedescriptionschema
MCPTool
MCPTool is the BindAI Tool implementation created for each discovered external tool.
Its public properties include:
- tool name
- tool description
- parameter schema
ToolDefinition containing the discovered metadata.
This allows an external HTTP tool to participate in BindAI’s existing tool abstraction.
Tool Invocation
When anMCPTool is executed, the current implementation sends:
tool field contains the name of the discovered tool.
The arguments field contains the arguments supplied by the BindAI execution context.
Tool Arguments
When anMCPTool receives an execution context containing variables, those variables are used as the tool arguments.
For example:
variables, the implementation uses an empty argument dictionary.
The current MCP implementation does not perform additional argument transformation or validation beyond the behavior provided by the underlying BindAI tool definition and external service.
Tool Results
After invoking the external service, the response body is parsed as JSON. The JSON response is returned through BindAI’sToolResult:
HTTP Errors
The current implementation calls:ToolResult.
Applications should handle these failures at the appropriate application or agent boundary.
A conceptual flow is:
MCP and BindAI Tools
The main purpose of the package is to bridge external HTTP tools into the BindAI tool system. The relationship is:MCP and Agents
An application can expose discoveredMCPTool instances to an agent using the normal BindAI tool mechanisms.
The conceptual flow is:
MCP and Workflows
MCP tools can participate in workflows when they are exposed through BindAI’s normal tool system. For example:bindai-mcp itself.
MCP and Automation
Thebindai-mcp package does not currently provide its own automation or event-trigger integration.
MCP tools may still be used by applications that also use BindAI automation and event infrastructure, provided the tools are registered through the normal BindAI mechanisms.
For example:
Observability
Thebindai-mcp package does not currently provide a dedicated MCP observability system.
It also does not itself expose MCP-specific event types or an MCP event recorder.
Applications can still observe MCP-backed tool execution through whatever logging, instrumentation, or execution observability they apply around the BindAI tool and agent layers.
BindAI’s broader runtime observability facilities can therefore be used at the application level without implying that the MCP package itself implements tracing or monitoring.
Configuration
The currentMCPClient requires only a URL:
Authentication
The currentMCPClient implementation does not provide a built-in authentication mechanism.
In particular, the current client does not expose configuration for:
- API keys
- Bearer tokens
- OAuth
- client certificates
- custom authentication headers
Security
MCP-backed tools can provide access to external systems and should therefore be treated as security-sensitive application components. Applications should consider:- Authentication
- Authorization
- TLS
- Network restrictions
- Input validation
- External service permissions
- Tool permissions
- Secret management
- Logging of sensitive information
bindai-mcp client does not implement these concerns itself.
Do not expose sensitive external operations to agents unless the application intentionally allows them.
Tool Permissions
External services may expose tools that perform different levels of access. For example:Timeouts and Reliability
The currentMCPClient does not expose a configurable timeout parameter.
The underlying HTTP behavior is provided by httpx.
Applications that require strict timeout, retry, circuit-breaker, or resilience policies should account for this at the application or integration layer.
External HTTP services can fail because of:
- Network problems
- Service outages
- Invalid requests
- Authentication failures
- HTTP errors
- Unexpected responses
- Latency or timeout conditions
Testing
Thebindai-mcp package includes tests for its core behavior.
The current test coverage verifies:
- Tool discovery
- Tool metadata
- Tool schema mapping
- BindAI
ToolDefinitiongeneration - Tool invocation
- Tool argument forwarding
- Tool result handling
MCPTool instances.
The invocation test verifies that:
Example Test Contract
A discovered tool can look like:HTTP Bridge Contract
The current bridge has two core endpoints.Tool discovery
Tool invocation
output of the BindAI ToolResult.
Example Usage
A minimal application can discover external tools with:Docker
The MCP package itself does not start an HTTP server. It is a client-side integration package that communicates with an already-running HTTP service. When BindAI runs inside Docker, the configured MCP service must be reachable from the container. For example:Docker Compose
A Docker Compose deployment can include a BindAI application and an external HTTP tool service:bindai-mcp package itself does not provide a server container or Compose service.
Current Limitations
The current implementation is intentionally lightweight. It should not be described as a complete MCP protocol implementation. The current package does not implement a complete MCP stack including features such as:- Full protocol negotiation
- MCP session management
- MCP resources
- MCP prompts
- Multiple MCP transport implementations
- Standard MCP server implementation
- Built-in authentication
- OAuth flows
- MCP-specific tracing
- Full protocol compliance across MCP features
Tool objects.
MCP vs BindAI Connections
MCP and BindAI Connections provide different integration approaches.
Use a BindAI Connection when BindAI provides a dedicated integration for the service.
Use
bindai-mcp when the required capability is exposed through the compatible HTTP tool bridge.
MCP vs Local Tools
Local tools execute application-defined Python code. MCP tools represented byMCPTool forward execution to an external HTTP service.
Local tool:
Recommended Project Structure
An application using the MCP bridge may keep MCP-related setup separate from agents and workflows:Production Considerations
When deploying an application that uses the MCP bridge, consider:- External service availability
- Network connectivity
- Authentication requirements
- TLS
- Tool permissions
- Input validation
- HTTP failures
- Timeouts
- Retry policies
- Rate limits
- External service monitoring
- Secret management
Future MCP Capabilities
The MCP integration can be expanded in future releases. Potential areas include:- More complete MCP protocol support
- Standard MCP transports
- MCP resources
- MCP prompts
- Session management
- Authentication support
- Richer tool metadata
- Improved protocol compatibility
- MCP server functionality
- More advanced error and timeout handling
- Deeper observability integration
Best Practices
- Treat external MCP-backed services as external dependencies.
- Keep MCP configuration separate from agent business logic.
- Never hard-code credentials.
- Use secure configuration and secret storage.
- Expose only the tools an agent actually needs.
- Follow least-privilege principles.
- Validate external tool inputs.
- Handle HTTP failures explicitly.
- Use appropriate timeout and retry strategies at the application level.
- Test MCP integrations independently.
- Do not assume authentication is provided by
bindai-mcp. - Do not assume MCP resources or prompts are supported.
- Do not assume session management is available.
- Do not describe the v0.1 implementation as full MCP protocol compliance.
- Verify the capabilities of the external HTTP service before depending on them.
Summary
BindAI v0.1 provides a lightweight HTTP-based MCP integration through thebindai-mcp package.
The main flow is:
MCPClientMCPTool- HTTP tool discovery
- HTTP tool invocation
- Tool metadata and schema mapping
- BindAI
Toolintegration - JSON tool results
